package middleware

import (
	"fmt"
	"time"
)

var pporfFile = PprofFile{}

func init() {
	go func() {
		ticker := time.NewTicker(30 * time.Second)
		defer ticker.Stop() // 使用完毕后记得停止
		for {
			select {
			case t := <-ticker.C:
				logger.Info(fmt.Sprintf("Tick at %v", t))
				pporfFile.Do()
			}
		}
	}()
}
